<?php
 Zend_Loader::loadClass("CodesUtility");
 Zend_Loader::loadClass("BaseDBRow");
 class InventoryDAA extends BaseDBRow
{
	const _tablename = "projecte_inventory.inventory_daa";
	protected function setUp()
	{
		$this->_tableName = self::_tablename;		
	}
	
	public function getInventoryDAALineByInvId($invId,$invDAAId = -1) {
	
		Zend_Loader::loadClass("QueryCreator");
		
		$query = new QueryCreator();
		$query->addSelect(" * ");
		$query->addFrom($this->_tableName . " id ");
		
		// Edit Line
		if($invDAAId > 0 || $invDAAId == 0) {
			$query->addWhere(" id.inventory_daa_id = " . $invDAAId);	
		}
		
		$db = DBCon::instance();
		// echo  $query->createSQL();die();
		$result = $db->executeQuery($query->createSQL());
		return $result;
		
	}
	
}
?>